<?php
# 快递api

namespace app\applet\controller;

use think\Validate;

class Express
{
    public function __construct()
    {
        $this->express = new \app\applet\model\Express();
    }
    #查询物流公司接口
    public function expressCompany()
    {
        $data = $this->express->expressCompany();
        returnJson(200,"success",$data);
    }

    #查询快递状态
    public function queryExpress()
    {
        $param=input();
        $validate = new Validate([
            ['id', 'require', '快递公司ID不能为空'],
            ['num', 'require', '快递单号不能为空'],
        ]);
        if(!$validate->check($param))
        {
            returnJson(-2003,$validate->getError());
        }
        $data = $this->express->queryExpress($param);
        returnJson(200,"success",$data);

    }

}